package com.oo.packaging_2.itWorker;

/**
 * ItWorkers--${description}
 *
 * @author: Jovi
 * @createTime: 2017-04-19 17:02
 **/
public class ItWorkers {

    private String name;

    private int age;

    private String teachic;

    private int year;

    public ItWorkers(String name, int age, String teachic, int year) {
        this.name = name;
        this.setAge(age);
        this.teachic = teachic;
        this.year = year;
    }

    public ItWorkers() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age < 15) {
            System.out.println("年龄小于15岁");
            this.age = 15;
        }else
        this.age = age;
    }

    public String getTeachic() {
        return teachic;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public String worker(String company,String duty) {
        String msg = "姓名：" + this.name + "\n年龄：" + this.age + "\n技术方向："
                +this.teachic+"\n工作年限："+this.year+"\n目前就职于："
                +company+"\n职务是："+duty;
        return msg;
    }
}
